﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace DreamBox.BLL.Posts
{
    public static class Thumbnail
    {
        public static string Image(string content)
        {
            StringBuilder str = new StringBuilder();
            Regex r = new Regex(@"<img\s+[^>]*\s*src\s*=\s*([']?)(?<src>\S+)'?[^>]*/>", RegexOptions.Compiled | RegexOptions.IgnoreCase);
            foreach (Match m in r.Matches(content))
            {
                str.Append(m.Groups["src"].ToString().Replace("\"", ""));//.Replace("!tiezitupian", "")
                break;
            }
            return str.ToString();
        }
       
    }
}
